yExample
Description
The YExample is an element with different optical styles to indicate its different states. The YExample can be used to ...
Some uses for the YExample are:
Basic Structure
In the following the basic structure of the YExample shall be explained. For the general structure of a yComponent please visit the YBase-components basic-structure.
The YExample as seen above contains ...
Basic Element 1
The Element 1 can be used to... And contains...
Basic Element 2
The Element 2 can be used to... And contains...
Basic Element 3
The Element 3 can be used to... And contains...
Properties
Through its various properties the YExample can be configured to suit your needs. The display below provides you with an overview of all the YExample properties.
Properties can be changed directly through three methods:
- Inside the Toolbar, which is positioned in your workarea next to your component where you need it. It shows the most important properties, thus providing a fast and efficient way to configure your component in the most basic way.
- It may also occur in the Toolbar Extension, which is a seamless extension accesible as a dropdown item of the Toolbar. It extends the functionality of the Toolbar by providing advanced pickers for most used properties.
- Inside the Detail Panel, which is located in the righthand drawer. Every property of a component can be configured here.
- Generic
- Style
- Example
- Events
METAread more
The identifier of the component that is unique within a page.
The type of the component. For this component it is y-example.
The custom name of the component. It serves for better identification of the component.
The custom version of the Example-component. This can be used to ensure that all components work well together.
The CoreTheme, which will be apllied to the Example. For further information on themes visit the themes page.
The subtheme subordinated to the previously specified CoreTheme, which will be apllied to the Example. For further information on themes visit the themes page.
The group theme is a further variation of the subtheme which is specified especially for variations of a component inside the subtheme. For further information on themes visit the Theme-Manager page.
DISPLAYread more
This property specifies the display behavior of the component. This can be be set to:
- none
- block
- flex
- inline
This property specifies the type of positioning method used for the component. This can be be set to:
- static
- relative
- absolute
- sticky
- fixed
This property can toggle the visibility of the component. The two modes are completely hidden and fully shown.
SIZEread more
The minimum value for the width of the component. This can be set in:
- px
- pt
- em
- vw
- vh
- %
The minimum value for the height of the component. This can be set in:
- px
- pt
- em
- vw
- vh
- %
The value for the width of the component. This can be set in:
- px
- pt
- em
- vw
- vh
- %
- auto
The value for the height of the component. This can be set in:
- px
- pt
- em
- vw
- vh
- %
- auto
The maximum value for the width of the component. This can be set in:
- px
- pt
- em
- vw
- vh
- %
- none
The maximum value for the height of the component. This can be set in:
- px
- pt
- em
- vw
- vh
- %
- none
The flex property sets the length on flexible items. This sets the value in n-fold shares extrapolated to all other components with the flex display within the same container.
PLACEMENTread more
This property creates a space around the component, outside of the top border. This can be set in percent or pixels.
This property creates a space around the component, outside of the right border. This can be set in percent or pixels.
This property creates a space around the component, outside of the bottom border. This can be set in percent or pixels.
This property creates a space around the component, outside of the left border. This can be set in percent or pixels.
This property creates a space within the component, inside of the top border. This can be set in percent or pixels.
This property creates a space within the component, inside of the right border. This can be set in percent or pixels.
This property creates a space within the component, inside of the bottom border. This can be set in percent or pixels.
This property creates a space within the component, inside of the top border. This can be set in percent or pixels.
BACKGROUNDread more
The color of the background. This can be set as a color from a palette or a custom hex color.
BORDERread more
The color of the top border. This can be set as a color from a palette or a custom hex color.
The style of the top border. This can be be set to:
- solid
- dotted
- dashed
- none
The width of the top border. This can be set in percent or pixels.
The color of the right border. This can be set as a color from a palette or a custom hex color.
The style of the right border. This can be be set to:
- solid
- dotted
- dashed
- none
The width of the right border. This can be set in percent or pixels.
The color of the bottom border. This can be set as a color from a palette or a custom hex color.
The style of the bottom border. This can be be set to:
- solid
- dotted
- dashed
- none
The width of the bottom border. This can be set in percent or pixels.
The color of the left border. This can be set as a color from a palette or a custom hex color.
The style of the left border. This can be be set to:
- solid
- dotted
- dashed
- none
The width of the left border. This can be set in percent or pixels.
The radius of the corners of all the borders. This can be set in percent or pixels.
SHADOWread more
The shadow of the component. This is set by the 4 sub-properties x, y, blur and spread of the shadow-property, which can be further read about in the shadow-property section.
OPACITYread more
The opacity of all colored parts of the component. This value is set in percent.
LABELread more
The color of the label text. This can be set as a color from a palette or a custom hex color.
The font-family of the label text. This can be picked from a large list of provided fonts.
The font-weight of the label text. This can be set in a custom number, as example:
- 400 = normal(regular)
- 500 = medium
- 600 = semi bold
- 700 = bold
The font-size of the label text. This can be set in: -cm
- mm
- in
- px
- em
- ex
- ch
- rem
The font-style of the label text. This can be set to normal, italic or oblique.
The text-transformation of the label text. This can be set to:
- capitalize
- uppercase
- lowercase
- none
- full-width
The font-align of the label text. This property moves the label text to the desired position, it can be set to left, center or right.
The actual written text in the label. There is no limit to the number of characters.
ICONread more
The position of the icon-element inside the Example-component. This can be set to:
- iconLeft
- iconRight
- iconBoth
- none
The primary-color of the icon-element inside the Example-component. This can be set as a color from a palette or a custom hex color.
The secondary-color of the icon-element inside the Example-component. This can be set as a color from a palette or a custom hex color.
The size of the icon. This can be set in: -cm
- mm
- in
- px
The icon to be set as the left icon of the icon-element inside the Example-component.
The icon to be set as the right icon of the icon-element inside the Example-component.
STATEread more
This property can disable or enable the active-state of the Example-component.
This property can disable or enable the disabled-state of the Example-component.
TOOLTIPread more
The text of the tooltip, which is displayed when hovering over the Example-component. If you do not insert anything, no tooltip appears.
MISCread more
This property can configure the Example-component to cause an emit every click or to be used to set a variable true and false. DELETE
CONTROLread more
If this property is true the Example emits a command to create a new entity instance in the database on click. Clipboard
If this property is true the Example emits a command to read an entity instance in the database on click.
If this property is true the Example emits a command to update an entity instance in the database on click.
If this property is true the Example emits a command to delete an entity instance in the database on click.
INPUTread more
Usage
In this section you'll find a collection of application scenarios and examples that illustrate how to leverage the YExample in ways that deviate from its standard behavior, as defined by yBase. This section aims to inspire and guide you through various possibilities, helping you to implement more complex or unique functionalities tailored to your specific needs. General properties that are universally applicable can be found in the yBase usage section.
Category
Category > Group
The easiest way to configure properties of the GROUP-NAME-PLACEHOLDER-group, is to use the PICKER-NAME-PLACEHOLDER...
Important information about the PROPERTY-NAME-PLACEHOLDER-property is...
If there is something important to say about a property then it should be added like this!
- example configuration 1
- example configuration 2
- example configuration 3
Category
Category > GROUP-THAT-HAS-A-SPECIAL-PB2-PICKER-PLACEHOLDER
The GROUP-THAT-HAS-A-SPECIAL-PB2-PICKER-PLACEHOLDER-group can be either further configured in the Detail Panel or via the dedicated GROUP-THAT-HAS-A-SPECIAL-PB2-PICKER-PLACEHOLDER Picker that can be found in Toolbar by ACTION-FOR-ACTIVATING-SPECIAL-PICKER-PLACEHOLDER. There you can...
PROPERTY-FROM-PICKER-PLACEHOLDER
CATEGORY-THAT-HAS-A-SPECIAL-PB1-PLACEHOLDER
The CATEGORY-THAT-HAS-A-SPECIAL-PB1-PLACEHOLDER-category's properties can be edited in a special Toolbar by ACTION-FOR-ACTIVATING-SPECIAL-PB1-PLACEHOLDER. There you can...
Inside the special Toolbar the following entries can be found:
- entry 1
- entry 2
- entry 3
Category > GROUP-THAT-IS-INSIDE-A-SPECIAL-PB1-PLACEHOLDER
The GROUP-FROM-PICKER-PLACEHOLDER-group's properties can be changed by ACTION-TO-ADJUST-GROUP-PLACEHOLDER...
PROPERTY-FROM-PICKER-PLACEHOLDER
Category
GROUP-THAT-HAS-A-SPECIAL-PB1-PLACEHOLDER
The GROUP-THAT-HAS-A-SPECIAL-PB1-PLACEHOLDER-group's properties can be edited in a special Toolbar by ACTION-FOR-ACTIVATING-SPECIAL-PB1-PLACEHOLDER. There you can...
Inside the special Toolbar the following entries can be found:
- entry 1
- entry 2
- entry 3
PROPERTY-FROM-PICKER-PLACEHOLDER
Category
Category > Group
Double clicking on Case1 enables the inPlcace-edit for the element. Additionally the special Toolbar Picker becomes available.
Category
Category > Group
The group GROUPNAME only exists in COMPONENTNAME.It is used to configure the STRUCTURE LINK properties: PROPERTIES
Examples of use
Use Case 1
You can use the YExample to...
How to accomplish the use-case:
- do this
- do that
- ...
Use Case 2
You can use the YExample to...
How to accomplish the use-case:
- do this
- do that
- ...
Code examples
You can use the YExample to...
How to accomplish the use-case:
- do this
- do that
- ...
Code Example
This action has four parameters and returns a new string built from those parameters. In this example the user can submit the arguments via input fields and start the action by clicking on the "Send gift" button.
let action = api.actions.create("SendGift");
if (action !== undefined) {
// Get input field objects by their IDs
let cstNameObject = api.ui.getObject(12); // inp_name
let cstAgeObject = api.ui.getObject(13); // inp_age
let cstGiftObject = api.ui.getObject(15); // inp_gift
let cstMsgObject = api.ui.getObject(16); // inp_text
// Create JSON with arguments for RPC and write values of input fields to JSON object
let jsonArgument = {
CustName: cstNameObject.get("style", "content", "valueString"),
CustAge: cstAgeObject.get("style", "content", "valueNumber"),
CustText: cstMsgObject.get("style", "content", "valueString"),
CustGift: cstGiftObject.get("style", "content", "valueString"),
};
// Keep RPC result stored on server for 300 seconds
let ttlSeconds = 300;
action.execute(jsonArgument).then(
(success) => {
action.awaitResult().then(
(success) => {
console.log(success);
api.ui.getObject(20).set("style", "content", "value", success.value);
},
(error) => {
alert("error awaitResult");
}
);
},
(error) => {
alert("error execute action");
}
);
}